<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>将字符串数组转为数值数组</title>
    <style>
        *,
        *::after,
        *::before {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            min-height: 100vh;
        }

        :root:focus-within {
            scroll-behavior: smooth;
        }

        body {
            min-height: inherit;
        }
    </style>
</head>

<body>
</body>
<script>
    "use strict"; {
        let str = `2660,199`;
        let res = str.split(",").map(Number);
        str.split(",").map(Number);
        console.log(res);

        let res1 = [123, 456].map(String);
        console.log(`数组转为字符串`, res1);
    };
</script>

</html>